package com.neusoft.elmboot.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.neusoft.elmboot.po.User;
import com.neusoft.elmboot.po.UserCart;

@Mapper
public interface UserCartMapper {
	@Select("select * from usercart")
	public List<UserCart> listUserCart();
	
	@Select("select * from usercart where cartId=#{cartId} and cartPassword=#{cartPassword}")
	 public UserCart getUserCartByIdByPass(UserCart usercart);
	
	@Update("update usercart set userId=#{userId} where cartId=#{cartId}")
	 public int addUserById(UserCart usercart);
	
	@Select("select * from usercart where userId=#{userId}")
	 public UserCart getUserCartByUserId(UserCart usercart);
	
	@Update("update usercart set balance=#{balance} where userId=#{userId}")
	 public int subBalanceById(UserCart usercart);
	
	@Update("update usercart set amount=#{amount} where userId=#{userId}")
	 public int updateAmountById(UserCart usercart);

}
